home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11108 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  963 b 

  1. Path: news.cais.com!news
  2. From: jcastro@ids2.idsonline.com (Jose Castro)
  3. Newsgroups: comp.lang.c
  4. Subject: Q: waiting processes and signals
  5. Date: Thu, 21 Mar 1996 23:46:11 GMT
  6. Organization: Capital Area Internet Service info@cais.com 703-448-4470
  7. Message-ID: <4isppb$l1q@news.cais.com>
  8. NNTP-Posting-Host: ip171.idsonline.com
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. int onsignal()
  12.   {
  13.   printf("Hello\n");
  14.   }
  15.  
  16. server()
  17. {
  18.  
  19. signal( SIGUSR1, onsignal)
  20.  
  21. wait on socket
  22.  
  23. read data
  24.  
  25. print data
  26.  
  27. close socket
  28. }
  29.  
  30. When I send the signal (kill -USR1 pid) I get the Hello message,
  31. BUT my process  read something from the socket and terminates.
  32.  
  33. I know that when a signal is received on a waiting process and the 
  34. signal handler returns( Same as above) the system call that causes
  35. the wait( in this case the listen from the socket) returns and erno =
  36. EINTR.  Some how I have to tell my server to continue waiting after
  37. the signal has been process.  How do I do it????
  38.  
  39.  
  40. Thanks
  41.  
  42.